<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'map.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> 
    <script type="text/javascript">
       var geocoder; 
       var map; 
       function initialize() {
         geocoder = new google.maps.Geocoder();     
         var latlng = new google.maps.LatLng(-28.245, 113.222);     
         var myOptions = {       
         zoom: 18,       
         center: latlng,       
         mapTypeId: google.maps.MapTypeId.HYBRID     
         }     
         map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);   
         geocoder.geocode( { 'address': "中国湖南省长沙市长沙县板仓中路文世达办公用品超市"}, function(results, status) {         
            if (status == google.maps.GeocoderStatus.OK) {           
            map.setCenter(results[0].geometry.location);           
            var marker = new google.maps.Marker({               
            map: map,                
            position: results[0].geometry.location           
            });         
          }
        }); 
      }   
    </script> 

  </head>
  
  <body onload="initialize()">  
   <div id="map_canvas" style="width: 600px; height: 480px;"></div>   <div>     <input id="address" type="textbox" value="Sydney, NSW">     <input type="button" value="Encode" onclick="codeAddress()">   </div> 
  </body> 
</html>
